package com.suke.czx.modules.tb.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonProperty;


/**
 * 商品分类表
 *
 * @author developer
 * @email developer@163.com
 * @date 2025-05-14 18:12:29
 */
@Data
@TableName("tb_category")
public class TbCategory implements Serializable {
    public static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "分类ID (主键, 自增)")
    @JsonProperty(value = "id")
    public Integer id;

    @ApiModelProperty(value = "分类名称 (唯一)")
    @JsonProperty(value = "name")
    public String name;

    @ApiModelProperty(value = "父分类ID (用于支持二级分类, 外键关联category.id)")
    @JsonProperty(value = "parentId")
    public Integer parentId;

    @ApiModelProperty(value = "分类图标链接")
    @JsonProperty(value = "iconUrl")
    public String iconUrl;

    @ApiModelProperty(value = "排序字段")
    @JsonProperty(value = "sortOrder")
    public Integer sortOrder;

    @ApiModelProperty(value = "是否启用 (1-是, 0-否)")
    @JsonProperty(value = "isActive")
    public Integer isActive;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "createDate")
    public Date createDate;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "updateDate")
    public Date updateDate;


}
